package com.powernode.controller;

import com.powernode.domain.Sku;
import com.powernode.service.SkuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/prod/sku")
@Api(tags = "获取sku")
public class SkuController {

    @Autowired
    private SkuService skuService;

    @PostMapping("/loadSkuById")
    @ApiOperation("根据skuId获取Sku")
    List<Sku> loadSkuById(@RequestBody List<Long> skuIds) {
        return skuService.listByIds(skuIds);
    }
}
